Interpolator nodes are discussed in detail in the VRML 2.0 specification. Here we'll briefly look at the important featrues and look at a simple example of the use of an interpolator to move a ball.

Interpolator nodes are meant for use in key-framed animations. A given interpolator provides the definition for a function f on the interval (-infinity, infinity). Several key points are identified in the key field of the node. The value of f at each of these points is also given correspondingly in the keyValue field. For any key in between two explicit keys the browser calculates the corresponding keyValue as a linear interpolant of the two explicit keyValues.

Obviously if the function is a color then each keyValue is an SFColor, the keyValue field is therefore of type MFColor. Similarly if the function inteprolates coordinates then each keyValue will actually be a coordinate (vector of 3 floats).

There are six interpolator nodes based on what field is being interpolated :

The next interpolation step is triggered by a set_fraction eventIn which gives the node a key to compute a keyValue. This keyValue is sent out as the eventOut value_changed. It can be routed to the target animation.

In the following example we will look at a ball animated by a PositionInterpolator which causes it to move in a loop.

This example consists of: